return {
  "neovim/nvim-lspconfig",
  dependencies = {
    "SmiteshP/nvim-navic",
    "aznhe21/actions-preview.nvim",
  },
  config = function()
    local lspconfig = require("lspconfig")
    local servers = require("plugins.servers.lsp")

    for name, config in pairs(servers) do
      config = config or {}
      local opt = config
      if config.pre_setup then
        opt = config.opt or {}
        config.pre_setup(opt, lspconfig)
      end
      lspconfig[name].setup(opt)
    end

    vim.api.nvim_create_autocmd("LspAttach", {
      desc = "",
      callback = function(args)
        local bufnr = args.buf
        local client = vim.lsp.get_client_by_id(args.data.client_id)

        local opt = {
          buffer = bufnr
        }

        vim.keymap.set("n", "gd", "<CMD>lua vim.lsp.buf.definition()<CR>", opt)
        vim.keymap.set("n", "gh", "<CMD>lua vim.lsp.buf.hover()<CR>", opt)
        vim.keymap.set("n", "gD", "<CMD>lua vim.lsp.buf.declaration()<CR>", opt)
        vim.keymap.set("n", "gi", "<CMD>lua require('telescope.builtin').lsp_implementation()<CR>", opt)
        vim.keymap.set("n", "gr", "<CMD>lua require('telescope.builtin').lsp_references()<CR>", opt)
        vim.keymap.set("n", "gt", "<CMD>lua require('telescope.builtin').lsp_type_definitions()<CR>", opt);
        vim.keymap.set("n", "go", "<CMD>lua vim.lsp.buf.open_float()<CR>", opt)
        vim.keymap.set("n", "gp", "<CMD>lua vim.lsp.buf.goto_prev()<CR>", opt)
        vim.keymap.set("n", "gn", "<CMD>lua vim.lsp.buf.goto_next()<CR>", opt)
        vim.keymap.set("n", "<leader>=", "<CMD>lua vim.lsp.buf.format { async = true }<CR>", opt)
        vim.keymap.set("n", "<leader>ca", "<CMD>lua require('actions-preview').code_actions()<CR>", opt)

        if client.server_capabilities.documentSymbolProvider then
          local navic = require("nvim-navic")
          navic.attach(client, bufnr)
        end


        require("lsp_signature").on_attach()
      end
    })
  end
}
